package com.rongshu.view.userInfo.activity;

import android.support.v4.content.ContextCompat;
import android.support.v4.view.ViewPager;
import android.view.View;

import com.rongshu.R;
import com.rongshu.view.base.BaseActivity;
import com.rongshu.view.userInfo.adapter.pageadapter.EnshirneAriticleVoicePagerAdapter;
import com.rongshu.widget.TabPageIndicator;
import com.widget.NoScrollViewPager;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.OnClick;

public class EnshrineActivity extends BaseActivity {
    @BindView(R.id.indicator)
    TabPageIndicator indicator;
    @BindView(R.id.viewPager)
    NoScrollViewPager viewPager;

    private List<String> titles = null;

    @Override
    protected int initLayout() {
        return R.layout.activity_enshrine_view;
    }

    @Override
    protected void initView() {
        titles = new ArrayList<>();
        titles.add("文章");
        titles.add("声音");
        EnshirneAriticleVoicePagerAdapter pageAdapter = new EnshirneAriticleVoicePagerAdapter(getSupportFragmentManager());
        pageAdapter.setTitles(titles);
        viewPager.setAdapter(pageAdapter);
        indicator.setViewPager(viewPager);
        indicator.setIndicatorMode(TabPageIndicator.IndicatorMode.MODE_WEIGHT_NOEXPAND_SAME);// 设置模式，一定要先设置模式
        indicator.setIndicatorColor(ContextCompat.getColor(this, R.color.color_3CC051));// 设置底部导航线的颜色
        indicator.setTextColorSelected(ContextCompat.getColor(this, R.color.color_3CC051));// 设置tab标题选中的颜色
        indicator.setTextSize((int) getResources().getDimension(R.dimen.dd_dimen_30px));// 设置字体大小
        viewPager.setNoScroll(true);
    }

    @Override
    protected void initData() {

    }

    @Override
    protected void updateViews(boolean isRefresh) {

    }

    @OnClick({R.id.layout_back})
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.layout_back:
                finish();
                break;
        }
    }
}
